'''
历史记录详情接口
"recordId": 335-- 对应的任务名称是----jobName: "周期任务--每周一到周五下午2:15起飞"
'''
import allure
import requests
import conftest
from common.logger import Log



class Test_getRecord():

    def setup_method(self):
        # 定义登录接口URL地址
        self.getRecordDetail_url = "http://192.168.3.182:9990/airservice-device/record/getRecordDetail"
        #实例化日志模块
        self.log = Log("历史记录查询接口").get_logger()


    @allure.step(title="历史记录详情接口")
    def test_getRecordDetail_case(self):
        self.getRecordDetail_data={
                                "recordId": 335
                            }
        response = requests.post(url=self.getRecordDetail_url, json=self.getRecordDetail_data, headers=conftest.headers_data)

        #添加断言
        assert response.json().get("message") == "success"
        assert  response.json().get("success") == True

        #打印日志
        self.log.info("历史记录详情：{}".format(response.json()))